<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>查看考试记录</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<div class="container">

    <h1 class="mt-5">考试记录</h1>

    <!-- 导航菜单 -->
    <div class="mt-4 mb-4">
        <ul class="nav nav-pills">
            <li class="nav-item">
                <a class="nav-link" href="${pageContext.request.contextPath}/student/home">首页</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" id="viewExamsLink" href="${pageContext.request.contextPath}/student/examList">查看试卷</a>
            </li>
            <li class="nav-item">
                <a class="nav-link active" id="viewExamRecords" href="#">查看考试记录</a>
            </li>
        </ul>
    </div>

    <!-- 学生考试记录 -->
    <div class="card mt-4">
        <div class="card-header">
            <h4>考试记录</h4>
        </div>
        <div class="card-body">
            <!-- 动态生成考试记录表格 -->
            <table class="table table-bordered" id="examRecordsTable">
                <thead>
                <tr>
                    <th>考试标题</th>
                    <th>出卷人</th>
                    <th>总分</th>
                    <th>我的成绩</th>
                    <th>提交时间</th>
                </tr>
                </thead>
                <tbody>
                <!-- 通过异步请求填充考试记录 -->
                </tbody>
            </table>
        </div>
    </div>


    <!-- 试题解析的模态框 -->
    <div class="modal fade" id="solutionModal" tabindex="-1" aria-labelledby="solutionModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title text-center w-100" id="solutionModalLabel">试题解析</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <div class="text-center mb-4">
                        <h3><span id="examTitle"></span></h3>
                        <h5>
                            出卷人：<span id="teacherName"></span>
                            <span class="mx-3"></span> <!-- 添加一个空的span，设置水平间距 -->
                            我的得分：<span id="totalScore"></span>
                        </h5>

                    </div>
                    <!-- 介绍性文字 -->
                    <p class="mt-3">备注：本卷为单选题，每题 <span id="scorePerQuestion"></span> 分</p>
                    <!-- 问题列表 -->
                    <div id="questionsList"></div>
                </div>
            </div>
        </div>
    </div>




</div>

<script src="${pageContext.request.contextPath}/static/js/student/viewExamRecords.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>

</body>
</html>
